from django.db import models

# Create your models here.
class Movies(models.Model):
    id = models.AutoField(primary_key=True)
    detailLink = models.CharField('详情链接', max_length=255, default='')
    rate = models.CharField('评分', max_length=20, default='')  # 评分长度较短，保留CharField
    title = models.CharField('影片名', max_length=255, default='')
    cover = models.CharField('封面', max_length=255, default='')
    year = models.CharField('年份', max_length=20, default='')  # 年份长度固定，缩短max_length
    type = models.CharField('类型', max_length=100, default='')  # 类型无需255
    country = models.CharField('国家', max_length=100, default='')  # 国家无需255
    language = models.CharField('语言', max_length=100, default='')  # 语言无需255
    uptime = models.CharField('时间', max_length=50, default='')  # 时间无需255
    movietime = models.CharField('时长', max_length=50, default='')  # 时长无需255
    comment = models.CharField('评论量', max_length=20, default='')  # 评论量较短
    starts = models.CharField('星级', max_length=50, default='')  # 星级无需255
    summary = models.TextField('简介', default='')  # 简介内容较长，改为TextField
    comments = models.TextField('五条热评', default='')  # 已为TextField，保留
    imglist = models.TextField('图片链接', default='')  # 图片链接可能多个，改为TextField
    movieurl = models.CharField('视频链接', max_length=255, default='')
    createtime = models.DateField('创建时间', auto_now=True)
    class Meta:
        db_table = 'movies'

class Comments(models.Model):
    id = models.AutoField(primary_key=True)
    movieName=models.CharField('电影名',max_length=255,default='')
    commentContent=models.CharField('电影评论',max_length=255,default='')
    class Meta:
        db_table = 'comments'

class Users(models.Model):
    id = models.AutoField('id',primary_key=True)
    username = models.CharField('用户名', max_length=255, default='')
    password = models.CharField('密码', max_length=255, default='')
    info=models.CharField('个人描述',max_length=255,default='')
    avatar = models.FileField('用户头像', upload_to='avatar/', default='avatar/default.jpg')
    class Meta:
        db_table = 'users'